package com.jake.sort.utils;

import com.jake.sort.vo.Countable;

import java.util.Comparator;
import java.util.List;

public class SortUtils {

    public static void sortListByCountableFields(List<Countable> countables) {
        countables.sort(Comparator.comparingInt(Countable::getAge)
                .thenComparingInt(Countable::getHeight)
                .thenComparingInt(Countable::getWeight));
    }
}
